package com.yuanchu.order.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yuanchu.common.validator.ValidationGroups;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 购物车记录表
 * 
 * @author adan
 * @email 2028038953@gmail.com
 * @date 2023-12-19 20:57:21
 */
@Data
@TableName("yoshop_cart")
public class YoshopCartEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 主键ID
	 */
	@TableId
	private Integer id;
	/**
	 * 商品ID
	 */
	@NotNull(groups ={ValidationGroups.Update.class}, message = "修改必须指定商品id")
	@NotNull(groups = {ValidationGroups.Insert.class}, message = "新增必须指定商品id")
	private Integer goodsId;
	/**
	 * 商品sku唯一标识
	 */
	@NotBlank(groups ={ValidationGroups.Update.class}, message = "修改必须指定商品skuId")
	@NotBlank(groups = {ValidationGroups.Insert.class}, message = "新增必须指定商品skuId")
	private String goodsSkuId;
	/**
	 * 商品数量
	 */
	@NotNull(groups = {ValidationGroups.Update.class}, message = "修改必须指定商品数量")
	@NotNull(groups = {ValidationGroups.Insert.class}, message = "新增必须指定商品数量")
	private Integer goodsNum;
	/**
	 * 用户ID
	 */
	private Integer userId;
	/**
	 * 是否删除
	 */
	private Integer isDelete;
	/**
	 * 商城ID
	 */
	private Integer storeId;
	/**
	 * 创建时间
	 */
	private String createTime;
	/**
	 * 更新时间
	 */
	private String updateTime;

	/**
	 * 商品信息
	 */
	@TableField(exist = false)
	private YoshopGoodsEntity goods;

}
